package sia.knights;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import sia.knights.config.KnightConfig;

/**
 * Created by dongl on 2017/12/28.
 */
public class Main {


    public static void main(String[] args) throws Exception {
        ClassPathXmlApplicationContext context =
                new ClassPathXmlApplicationContext(
                        "knight.xml");
        Knight knight = context.getBean(Knight.class);
        knight.embarkOnQuest();


     /*   //首先是应用程序上下文
        ApplicationContext ctx =
                new AnnotationConfigApplicationContext(KnightConfig.class);
        Quest quest = ctx.getBean(Quest.class);
        Knight knight = ctx.getBean(Knight.class);
        knight.embarkOnQuest();*/

    }
}

